var e = require("../../../components/wux"), t = getApp();

Page({
    data: {
        phone: "",
        selectRoleValue: -1,
        selectRoleName: "请选择角色",
        roleActive: "",
        provinceActive: "",
        roleIndex: 0,
        roleNames: [],
        roleValues: [],
        selectCity: "请选择您所在城市",
        province: "",
        city: "",
        county: ""
    },
    changeRole: function(e) {
        this.setData({
            selectRoleValue: this.data.roleValues[e.detail.value],
            selectRoleName: this.data.roleNames[e.detail.value],
            roleActive: "active"
        });
    },
    onTapCity: function() {
        e.$wuxPickerCity.init("city", {
            title: "请选择所在城市",
            value: [ 0, 0, 0 ],
            onChange: function(e) {
                this.setData({
                    selectCity: e.value,
                    provinceActive: "active",
                    province: e.value[0],
                    city: e.value[1],
                    county: e.value[2]
                });
            }
        });
    },
    onLoad: function(e) {
        this.setData({
            phone: e.phone,
            roleNames: t.globalData.roleRegisterNames,
            roleValues: t.globalData.roleRegisterValues
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});